<template>
  <div class="pricing-item">
    <h3 class="text-purple-1300 text-22 leading-7 font-semibold break-words w-full">
      {{$t('vs_pricing',{toolName: $websiteName(toolData)})}}
    </h3>
    <div class="mt-7 space-y-4"
      v-if="toolData && hasRealVal(toolData.prices) && toolData.prices.length > 0">
      <div class="mt-7 space-y-4">
        <div class="max-w-sm mx-auto border border-gray-2000 rounded py-6 px-5 text-center"
          v-for="(item,key) in toolData.prices"
          :key="key">
          <div class="text-xl text-gray-1000 break-words font-semibold">{{item.title}}</div>
          <p class="text-28 leading-8 text-gray-1000 break-words font-semibold mt-4"
            v-if="item.price">{{item.price}}</p>
          <p class="text-md text-gray-1500 break-words mt-2"
            v-if="item.cycle">{{item.cycle}}</p>
        </div>
      </div>
    </div>
    <el-empty v-else
      :description="$t('vs_noData')"></el-empty>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'CompareVsPricing',
  props: {
    toolData: {
      type: Object | null,
      default() {
        return {}
      },
    },
  },
  computed: {
    ...mapState({
      locale: (state) => state.locale,
    }),
  },
}
</script>
